<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp"%>
<%@include file="/common/javascript.jsp"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>课程选择</title>
    <script type="text/javascript">
    var courseGridManager = null;
    $(function () {
       $("#maingrid4").ligerGrid({
            columns: [
      				{ display: '课程编码', name: 'cid', align: 'left', width:'15%', minWidth: 60 },
    				{ display: '课程名称', name: 'title', width:'25%',minWidth: 120 },
    				{ display: '课程学时', name: 'period',width:'15%', minWidth: 140 },
    				{ display: '老师编号', name: 'tid',width:'15%', minWidth: 140 },
    				{ display: '老师名称', name: 'tName',width:'20%', minWidth: 140 }
            ],  pageSize:10,
            dataAction: 'server', url: '${ctx}/qso/courseRegister/listCTView', sortName: 'course.id',
            width: '100%', height: '80%', numPerPage:20,rownumbers:true,
            checkbox:true
        }); 
       courseGridManager=$("#maingrid4").ligerGetGridManager();
        $("#pageloading").hide();
    });
    
    function selectOK(){
    	var rows = courseGridManager.getCheckedRows();
    	var num=rows.length;
    	var row=courseGridManager.getSelected();
    	if (1 == num ) {
    		window.parent.callBackOK(row);
    	}else{
    		$.ligerDialog.warn('请选择一行');
    	}
    }
    
    function selectCancel(){
    	window.parent.callBackCancel();
    }
    </script>
</head>
<body style="padding:6px; overflow:hidden;">
  <div class="l-clear"></div>
    <div id="maingrid4" style="margin-top:0px;"></div>
	<div class="l-dialog-buttons" style="">
		<div class="l-dialog-buttons-inner">
			<div class="l-dialog-btn">
				<div class="l-dialog-btn-l"></div>
				<div class="l-dialog-btn-r"></div>
				<div class="l-dialog-btn-inner" onclick="selectCancel()">取消</div>
			</div>
			<div class="l-dialog-btn">
				<div class="l-dialog-btn-l"></div>
				<div class="l-dialog-btn-r"></div>
				<div class="l-dialog-btn-inner" onclick="selectOK()">提交</div>
			</div>
			<div class="l-clear"></div>
		</div>
	</div>
  <div style="display:none;">
</body>
</html>
